home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / MACSHELL / MS1 / SHELL_SO / PARSE.H < prev    next >
Text File  |  1992-12-02  |  3KB  |  126 lines

  1. /*
  2.  *    MacShell Source File
  3.  *
  4.  *    Copyright (c) 1989, 1990, 1991, 1992  Suick Bay Technologies.  All rights reserved.
  5.  *
  6.  *
  7.  *    RESTRICTIONS ON MacShell program and source code.
  8.  *
  9.  *    Ñ╩MacShell¬ is a product of Suick Bay Technologies and is provided for
  10.  *    restricted use by the owner of the CDROM "Disk to the future II".
  11.  *
  12.  *    Ñ╩No permission is granted for any commercial use without the written
  13.  *    consent of the Suick Bay Technologies.
  14.  *
  15.  *    Ñ╩No permission is granted for any redistribution of any kind use without
  16.  *    the written consent of the Suick Bay Technologies.
  17.  *
  18.  *    Ñ╩Permission is granted to use this for any personal noncommercial use.
  19.  *
  20.  *    Ñ╩You may not distribute source or executable code at all, nor may you 
  21.  *    distribute it with or within a commercial product without the written
  22.  *    consent of the Suick Bay Technologies.  Please send modifications to 
  23.  *    the author for inclusion in updates to the program.  Thanks.
  24.  *
  25.  *
  26.  *    MacShell¬ IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  27.  *    WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  28.  *    PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
  29.  *
  30.  *    SUICK BAY TECHNOLOGIES SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  31.  *    INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY MACSHELL
  32.  *    OR ANY PART THEREOF. 
  33.  *
  34.  *    In no event will Suick Bay Technologies be liable for any lost revenue
  35.  *    or profits or other special, indirect and consequential damages, even if
  36.  *    Suick Bay Technologies has been advised of the possibility of such damages.
  37.  *
  38.  *    Suick Bay Technologies can be reached at:
  39.  *    
  40.  *    8768 Cottonwood lane
  41.  *    Maple Grove, MN 55369
  42.  *    Voice: (612) 425-7025
  43.  *    AppleLink: D5233
  44.  *    
  45.  *
  46.  *    No parts of this software may be reproduced or stored in a
  47.  *    retrieval system or transmitted in any form, or any means,
  48.  *    electronic, mechanical, photocopying, recording or otherwise,
  49.  *    without the prior written permission of Suick Bay Technologies.
  50.  *    
  51.  *    Spread the word and not the disk.
  52.  *    
  53.  *    SPK 012290    :    Initial
  54.  */
  55.  
  56. /*
  57.  *    command line tokens
  58.  */
  59. char    *GetShellToken( char *, char *, int16 * );
  60.  
  61. enum
  62.     {
  63.     tkn_identifier = 1,
  64.     tkn_digit,
  65.     tkn_eol,
  66.     tkn_pipe,            /* '|'            */
  67.     tkn_pipeOutErr,        /* '|&'            */
  68.     tkn_andf,            /* '&&'            */
  69.     tkn_orf,            /* '||'            */
  70.     tkn_separator,        /* ';'            */
  71.     tkn_caseDelimit,    /* ';;'            */
  72.     tkn_background,        /* '&'            */
  73.     tkn_var,            /* '$'            */
  74.     
  75.     tkn_leftParen,        /* '('            */
  76.     tkn_rightParen,        /* ')'            */
  77.     
  78.     tkn_inputRedirect,    /* '<'            */
  79.     tkn_inputFromHere,    /* '<<'            */
  80.     tkn_outputRedirect,    /* '>'            */
  81.     tkn_outputAppend,    /* '>>'            */
  82.     
  83.     tkn_comment,        /* '#'            */
  84.     
  85.     tkn_singleQuote,    /* '''            */
  86.     tkn_doubleQuote,    /* '"'            */
  87.     
  88.     tkn_if,                /* 'if'            */
  89.     tkn_then,            /* 'then'        */
  90.     tkn_else,            /* 'else'        */
  91.     tkn_elif,            /* 'elif'        */
  92.     tkn_fi,                /* 'fi'            */
  93.     
  94.     tkn_case,            /* 'case'        */
  95.     tkn_in,                /* 'in'            */
  96.     tkn_esac,            /* 'esac'        */
  97.     
  98.     tkn_for,            /* 'for'        */
  99.     tkn_while,            /* 'while'        */
  100.     tkn_until,            /* 'until'        */
  101.     tkn_do,                /* 'do'            */
  102.     tkn_done,            /* 'done'        */
  103.     
  104.     tkn_break,            /* 'break'        */
  105.     tkn_continue,        /* 'continue'    */
  106.     tkn_exit,            /* 'exit'        */
  107.  
  108.     tkn_leftCurl,        /* '{'            */
  109.     tkn_rightCurl,        /* '}'            */
  110.     tkn_unknown
  111.     };
  112.  
  113. /*
  114.  *    parse errors
  115.  */
  116. enum
  117.     {
  118.     se_expectFile = 1,
  119.     se_noProcSlots,
  120.     se_unknownCmd,
  121.     se_ioRedir,
  122.     se_unknown
  123.     };
  124.     
  125.  
  126.